import Vue from 'vue'
import Router from 'vue-router'
const Home = () => import('../pages/Home')
const MyMusic = () => import('../pages/MyMusic')
const Singer = () => import('../pages/Singer')
const SongList = () => import('../pages/SongList')
const Search = () => import('../pages/Search')
const Lyric = () => import('../pages/Lyric')
const SignUp = () => import('../pages/SignUp')
const LoginIn = () => import('../pages/LoginIn')
const Setting = () => import('../pages/Setting')
const SingerAlbum = () => import('../pages/SingerAlbum')
const SongListAlbum = () => import('../pages/SongListAlbum')

Vue.use(Router)

export default new Router({
   routes:[
       {
           path: '/',
           name: 'name',
           component: Home
       },
       {
           path: '/my-music',
           name: 'my-music',
           component: MyMusic
       },
       {
           path: '/singer',
           name: 'singer',
           component: Singer
       },
       {
           path: '/song-list',
           name: 'song-list',
           component: SongList
       },
       {
           path: '/search',
           name: 'search',
           component: Search
       },
       {
           path: '/lyric',
           name: 'lyric',
           component: Lyric
       },
       {
           path: '/sign-up',
           name: 'sign-up',
           component: SignUp
       },
       {
           path: '/login-in',
           name: 'login-in',
           component: LoginIn
       },
       {
           path: '/setting',
           name: 'setting',
           component: Setting
       },
       {
           path: '/singer-album/:id',
           name: 'singer-album',
           component: SingerAlbum
       },
       {
           path: '/song-list-album/:id',
           name: 'song-list-album',
           component: SongListAlbum
       }
   ] ,
    scrollBehavior(to, from, savedPosition){
       console.log('无用' + to + from + savedPosition);
       return {x: 0, y: 0}
    }
});